import request from '@/utils/request'
import linq from 'linq'
/* 
    学生获奖情况
*/ 
export async function getXshj(XXID,CJPC){
    let res =  await request({
        url: `/Xshj?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
        method: 'get',
      })
    return res.data.value;
}
export async function bulkAddXshj(data){
  let res =  await request({
      url: '/Xshj/BulkAddXshj',
      method: 'post',
      data:data
    })
  return res.data.value;
}
export async function updateXshj(model){
    let res =  await request({
        url: `/Xshj(${model.ID})`,
        method: 'put',
        data: model
      })
      return res.data;
}
export async function deleteXshj(model){
    let res = await  request({
        url: `/Xshj/${model.ID}`,
        method: 'delete',
      })
      return res.data;
}
export async function addXshj(model){
    let res =  await request({
      url: '/Xshj',
      method: 'post',
      data: model,
    })
    return res.data;
}

/* 
    学校获奖情况
*/
export async function getXxhj(XXID,CJPC){
  let res =  await request({
      url: `/Xxhj?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
      method: 'get',
    })
  return res.data.value;
}
export async function bulkAddXxhj(data){
  let res =  await request({
      url: '/Xxhj/bulkAddXxhj',
      method: 'post',
      data:data
    })
  return res.data.value;
}
export async function updateXxhj(model){
  let res =  await request({
      url: `/Xxhj(${model.ID})`,
      method: 'put',
      data: model
    })
    return res.data;
}
export async function deleteXxhj(model){
  let res = await  request({
      url: `/Xxhj/${model.ID}`,
      method: 'delete',
    })
    return res.data;
}
export async function addXxhj(model){
  let res =  await request({
    url: '/Xxhj',
    method: 'post',
    data: model,
  })
  return res.data;
}


/* 
    学生社团红十字会获奖情况
*/
export async function getSthj(XXID,CJPC){
  let res =  await request({
      url: `/Sthj?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
      method: 'get',
    })
  return res.data.value;
}
export async function bulkAddSthj(data){
  let res =  await request({
      url: '/Sthj/bulkAddSthj',
      method: 'post',
      data:data
    })
  return res.data.value;
}
export async function updateSthj(model){
  let res =  await request({
      url: `/Sthj(${model.ID})`,
      method: 'put',
      data: model
    })
    return res.data;
}
export async function deleteSthj(model){
  let res = await  request({
      url: `/Sthj/${model.ID}`,
      method: 'delete',
    })
    return res.data;
}
export async function addSthj(model){
  let res =  await request({
    url: '/Sthj',
    method: 'post',
    data: model,
  })
  return res.data;
}
/* 
    质量工程表
*/
export async function getZlgc(XXID,CJPC){
  let res =  await request({
      url: `/Zlgc?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
      method: 'get',
    })
  return res.data.value;
}
export async function bulkAddZlgc(data){
  let res =  await request({
      url: '/Zlgc/BulkAddZlgc',
      method: 'post',
      data:data
    })
  return res.data.value;
}
export async function updateZlgc(model){
  let res =  await request({
      url: `/Zlgc(${model.ID})`,
      method: 'put',
      data: model
    })
    return res.data;
}
export async function deleteZlgc(model){
  let res = await  request({
      url: `/Zlgc/${model.ID}`,
      method: 'delete',
    })
    return res.data;
}
export async function addZlgc(model){
  
  let res =  await request({
    url: '/Zlgc',
    method: 'post',
    data: model,
  })
  return res.data;
}


/* 
    就业单位与联系人表
*/
export async function getJydw(XXID,CJPC){
  let res =  await request({
      url: `/Jydw?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
      method: 'get',
    })
  return res.data.value;
}
export async function bulkAddJydw(data){
  let res =  await request({
      url: '/Jydw/BulkAddJydw',
      method: 'post',
      data:data
    })
  return res.data.value;
}
export async function updateJydw(model){
  let res =  await request({
      url: `/Jydw(${model.ID})`,
      method: 'put',
      data: model
    })
    return res.data;
}
export async function deleteJydw(model){
  let res = await  request({
      url: `/Jydw/${model.ID}`,
      method: 'delete',
    })
    return res.data;
}
export async function addJydw(model){
  let res =  await request({
    url: '/Jydw',
    method: 'post',
    data: model,
  })
  return res.data;
}


/* 
    社会捐赠情况表
*/
export async function getShjz(XXID,CJPC){
  let res =  await request({
      url: `/Shjz?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
      method: 'get',
    })
  return res.data.value;
}
export async function bulkAddShjz(data){
  let res =  await request({
      url: '/Shjz/BulkAddShjz',
      method: 'post',
      data:data
    })
  return res.data.value;
}
export async function updateShjz(model){
  let res =  await request({
      url: `/Shjz(${model.ID})`,
      method: 'put',
      data: model
    })
    return res.data;
}
export async function deleteShjz(model){
  let res = await  request({
      url: `/Shjz/${model.ID}`,
      method: 'delete',
    })
    return res.data;
}
export async function addShjz(model){
  let res =  await request({
    url: '/Shjz',
    method: 'post',
    data: model,
  })
  return res.data;
}


/* 
    招生情况
*/
export async function getZsqk(XXID,CJPC){
  let res =  await request({
      url: `/Zsqk?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
      method: 'get',
    })
  return res.data.value;
}


/* 
    就业率
*/
export async function getJyl(XXID,CJPC){
  let res =  await request({
      url: `/Jyl?$filter=XXID eq '${XXID}' and CJPC eq '${CJPC}'`,
      method: 'get',
    })
  return res.data.value;
}